﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TibcoQueueMonitor.Entities;

namespace TibcoQueueMonitor
{
    /// <summary>
    /// Event arguments that contain the TIBCO administration queue data
    /// retrieved from the EMS server (or the exception if an error was
    /// detected).
    /// </summary>
    public class AdminDataEventArgs : EventArgs
    {
        #region Private Fields
        private TibcoAdministrationData _data;
        private Exception _ex;

        #endregion //Private Fields

        #region Public Properties
        /// <summary>
        /// Gets or sets the exception that was raised when an error was
        /// found while retrieving the TIBCO administration data.
        /// </summary>
        /// <value>The exception.</value>
        public Exception Exception
        {
            get { return _ex; }
        }

        /// <summary>
        /// Gets or sets the data that will be published.
        /// </summary>
        /// <value>The data.</value>
        public TibcoAdministrationData Data
        {
            get { return _data; }
        }

        #endregion //Public Properties

        #region Constructors
        /// <summary>
        /// Initializes a new instance of the <see cref="AdminDataEventArgs"/> class.
        /// </summary>
        /// <param name="data">The data.</param>
        public AdminDataEventArgs(TibcoAdministrationData data)
            : base()
        {
            _data = data;
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="AdminDataEventArgs"/> class.
        /// </summary>
        /// <param name="ex">The exception raised by the TibcoAdminManager.</param>
        public AdminDataEventArgs(Exception ex)
            : base()
        {
            _ex = ex;
        }

        #endregion //Constructors
    }
}
